%%defien global server name

-define(SERVER_NAME, ifriend_server).




%% registered users here . Main table , queried a lot 
-record(account,{
                 id,
                 username,		%%optional
                 phone,
                 nickname,
                 followedlist,
                 followerslist,                 
				 permission,		%% your account be visited / Random Visit
				 fid			%id of frame and replies
                 }).

%% vard . maybe 
-record(phonebook,{}).


-record(contacts,{id,phone,nick,email,address,other}).  %% table type: bag.  %%index of phone


-record(login,{
               id,
               phone,
               username,
               status,
               session		
               }).

-record(frame,{
               id,               
               frame,%frame of mind
               fid	%% id&time
               }).

-record(reply,{
				 fid, %% id&time	
				 local_time,
				 poster,
				 replyto,
				 content
				 }).

-record(replies_without_fid,{
				 local_time,
				 poster,
				 replyto,
				 content							
				 }).


%% bag, id = receivers id 
-record(notification,{
					   id,
					   local_time,
					   poster,
					   type,		%%   reply | post
					   content,
					   link,
					   fresh		%% 1 | 0    1:fresh    
					   }).

-record(history,{
                 fid,
                 local_time,
				 frame,
                 list_replies_without_fid
                 }).

-record(idwithtime,{
					id,
					local_time
				   }).

-record(metalog,{logtime,logfunc,logarg}).

-define(HOST_INIT_LIFE,5).


-record(filemeta, {id, name, size, chunklist, createT,ctime, mtime,tag,parent}).

-record(chunkmapping, {chunkid, chunklocations}).
